package com.zyy.transaction.demo.controller;

import com.zyy.transaction.demo.pojo.request.TransferRequestPojo;
import com.zyy.transaction.demo.service.TransferService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zhangyiying
 * @ClassName: TransferController
 * @Description:
 * @date 2022/2/24 18:46
 */
@RestController
public class TransferController {

    @Autowired
    private TransferService transferService;

    @PostMapping("/transfer")
    public String transfer(TransferRequestPojo transferRequestPojo){
        this.transferService.transfer(transferRequestPojo.getFromCardNo(),
//        this.transferService.substitute(transferRequestPojo.getFromCardNo(),
                                    transferRequestPojo.getToCardNo(),
                                    transferRequestPojo.getMoney());
        return "success";
    }


}
